solving equations with infinitely many solutions